<script>
export default {
  name: "ResourceList",
  props: {
    data: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    return {
      tableOptions: {
        //新增按钮
        addBtn: false,
        header: false,
        viewBtn: false,
        delBtn: false,
        editBtn: false,
        refreshBtn: false,
        columnBtn: false,
        searchShowBtn: false,
        stripe: false,
        selection: false,
        tip: false,
        // simplePage: false,
        searchMenuSpan: 8,
        border: true,
        index: false,
        indexWidth: 60,
        indexLabel: "序号",
        menuWidth: 252,
        menu: false,
        align: "left",
        menuAlign: "left",
        dialogWidth: "40%",
        dialogClickModal: false,
        dialogType: "drawer",
        span: 24,
        dialogCustomClass: "huilan-drawer-form",
        emptyText: this.$t('aicosCommon.notData'),
        column: [
          {
            label: "分类",
            prop: "status",
            formatter(val) {
              if (val.status === 'starting') {
                return '启动中'
              } else if (val.status === 'running') {
                return '运行中'
              } else if (val.status === 'main_process') {
                return '实际运行主进程数'
              } else if (val.status === 'sub_resource_tracker') {
                return '实际运行resource_tracker子进程数'
              } else if (val.status === 'sub_spawn') {
                return '实际运行spawn子进程数'
              }

            }
          },
          {
            label: "数量",
            prop: "status_count"
          }
        ]
      }
    }
  },
  methods: {}
}
</script>

<template>
  <avue-crud
    ref="listRef"
    :option="tableOptions"
    :data="data"
  >
  </avue-crud>
</template>

<style scoped lang="scss">

</style>
